﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeBehind="GiaoVien.aspx.cs" Inherits="WTSQCB.GiaoVien" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        &nbsp; Quản lý giáo viên</p>
    <p>
        &nbsp;
        Thuộc Khoa:&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="Khoaddl" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="TenKhoa" DataValueField="MaKhoa" Width="150px">
        </asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thuộc Bộ môn:&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="Bomonddl" runat="server" DataSourceID="SqlDataSource2" DataTextField="TenBoMon" DataValueField="MaBoMon" Width="150px" AutoPostBack="True">
        </asp:DropDownList>
    </p>
    <p>
        <asp:GridView ID="GiaoViendgv" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="MaGiaoVien" DataSourceID="SqlDataSource3" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" Width="980px">
            <Columns>
                <asp:CommandField ButtonType="Button" ShowSelectButton="True" SelectText="CHỌN" />
                <asp:BoundField DataField="MaGiaoVien" HeaderText="Mã giáo viên" ReadOnly="True" SortExpression="MaGiaoVien" />
                <asp:BoundField DataField="TenGiaoVien" HeaderText="Tên giáo viên" SortExpression="TenGiaoVien" />
                <asp:BoundField DataField="NgaySinh" HeaderText="Ngày sinh" SortExpression="NgaySinh" />
                <asp:BoundField DataField="GioiTinh" HeaderText="Giới tính" SortExpression="GioiTinh" />
                <asp:BoundField DataField="HocVi" HeaderText="Học vị" SortExpression="HocVi" />
                <asp:BoundField DataField="CapBac" HeaderText="Cấp bậc" SortExpression="CapBac" />
                <asp:BoundField DataField="TenBoMon" HeaderText="Tên bộ môn" SortExpression="TenBoMon" />
            </Columns>
            <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
            <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
            <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
            <RowStyle BackColor="White" ForeColor="#003399" />
            <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
            <SortedAscendingCellStyle BackColor="#EDF6F6" />
            <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
            <SortedDescendingCellStyle BackColor="#D6DFDF" />
            <SortedDescendingHeaderStyle BackColor="#002876" />
        </asp:GridView>
    </p>
    <p>
        &nbsp;
        <asp:Button ID="Thembtn" runat="server" OnClick="Thembtn_Click" Text="THÊM" Width="80px" />
        &nbsp;
        <asp:Button ID="Suabtn" runat="server" OnClick="Suabtn_Click" Text="SỬA" Width="80px" />
        &nbsp;
        <asp:Button ID="Xoabtn" runat="server" OnClick="Xoabtn_Click" Text="XÓA" OnClientClick="return confirm('Bạn có muốn XÓA không ?')" Width="80px" />
    </p>
    <p>
        &nbsp;
        Thông tin chi tiết:&nbsp; </p>
    <p>
        &nbsp;
        Mã giáo viên:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="MaGiaoVientxt" runat="server" Width="200px"></asp:TextBox>
    &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="MaGiaoVientxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        Tên giáo viên:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:TextBox ID="TenGiaoVientxt" runat="server" Width="200px"></asp:TextBox>
    &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TenGiaoVientxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        Sinh ngày:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="Ngayddl" runat="server">
        </asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tháng:
        <asp:DropDownList ID="Thangddl" runat="server">
        </asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Năm:<asp:DropDownList ID="Namddl" runat="server" OnSelectedIndexChanged="Namddl_SelectedIndexChanged">
        </asp:DropDownList>
    </p>
    <p>
        &nbsp;
        Giới tính:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:DropDownList ID="GioiTinhddl" runat="server" AutoPostBack="True">
            <asp:ListItem>Nam</asp:ListItem>
            <asp:ListItem>Nữ</asp:ListItem>
        </asp:DropDownList>
    </p>
    <p>
        &nbsp;
        Học vị:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:DropDownList ID="HocViddl" runat="server" AutoPostBack="True">
            <asp:ListItem>Cử nhân</asp:ListItem>
            <asp:ListItem>Thạc sĩ</asp:ListItem>
            <asp:ListItem>Tiến sĩ</asp:ListItem>
        </asp:DropDownList>
    </p>
    <p>
        &nbsp;
        Cấp bậc:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:DropDownList ID="CapBacddl" runat="server" AutoPostBack="True">
            <asp:ListItem>Thiếu úy</asp:ListItem>
            <asp:ListItem>Trung úy</asp:ListItem>
            <asp:ListItem>Thượng úy</asp:ListItem>
            <asp:ListItem>Đại úy</asp:ListItem>
            <asp:ListItem>Thiếu tá</asp:ListItem>
            <asp:ListItem>Trung tá</asp:ListItem>
            <asp:ListItem>Thượng tá</asp:ListItem>
            <asp:ListItem>Đại tá</asp:ListItem>
        </asp:DropDownList>
    </p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="GiaoVienLoad" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="Bomonddl" DefaultValue="k1bcht" Name="mabomon" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="BoMonLoad" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="Khoaddl" DefaultValue="k1" Name="makhoa" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="SELECT * FROM [Khoa]"></asp:SqlDataSource>
    </p>
</asp:Content>
